load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//build:STRINGER.bzl", "stringer")

go_library(
    name = "colfetcher",
    srcs = [
        "cfetcher.go",
        "cfetcher_setup.go",
        "cfetcher_wrapper.go",
        "colbatch_direct_scan.go",
        "colbatch_scan.go",
        "index_join.go",
        ":gen-fetcherstate-stringer",  # keep
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colfetcher",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/col/colserde",
        "//pkg/col/typeconv",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/colconv",
        "//pkg/sql/colencoding",
        "//pkg/sql/colexec/colexecspan",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execreleasable",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/execstats",
        "//pkg/sql/memsize",
        "//pkg/sql/row",
        "//pkg/sql/rowcontainer",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/rowinfra",
        "//pkg/sql/scrub",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/util/buildutil",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
    ],
)

stringer(
    name = "gen-fetcherstate-stringer",
    src = "cfetcher.go",
    typ = "fetcherState",
)

go_test(
    name = "colfetcher_test",
    srcs = [
        "bytes_read_test.go",
        "main_test.go",
        "vectorized_batch_size_test.go",
    ],
    deps = [
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
